#include "JString.h"
//#include <string>
//
//std::string std::string::emptyString;
//
//std::string::std::string( char* c )
//{
//	this->length = strlen(c);
//	this->str = new char[this->length + 1];
//	strcpy(this->str,c);
//	this->str[this->length] = '\0';
//}
//
//std::string::std::string() : length(0),str(NULL)
//{
//
//}
//
//std::string::std::string( const std::string& s )
//{
//	this->length = s.length;
//	this->str = new char[this->length + 1];
//	strcpy(this->str,s.str);
//	this->str[this->length] = '\0';
//}
//
//std::string::~std::string()
//{
//	if(this->str != NULL)
//	{
//		delete this->str;
//	}
//}
//
//std::string& std::string::operator=( std::string& s )
//{
//	if(this != &s)
//	{
//		if(this->str != NULL)
//		{
//			delete this->str;
//		}
//		this->length = s.length;
//		this->str = new char[this->length + 1];
//		strcpy(this->str,s.str);
//		this->str[this->length] = '\0';
//		return *this;
//	}
//	else
//	{
//		return s;
//	}
//}
//
//std::string& std::string::operator=( const char* c )
//{
//	//Judge c is not it's self 'str'.
//	if(this->str != c)
//	{
//		if(this->str != NULL)
//		{
//			delete this->str;
//		}
//		this->length = strlen(c);
//		this->str = new char[this->length + 1];
//		strcpy(this->str,c);
//		this->str[this->length] = '\0';
//		return *this;
//	}
//	else
//	{
//		return *this;
//	}
//}
//
//std::string& std::string::operator+( const char* c )
//{
//		this->length += strlen(c);
//		char* pTmp = this->str;
//		this->str = new char[this->length + 1];
//		strcpy(this->str,pTmp);
//		strcat(this->str,c);
//		this->str[this->length] = '\0';
//		if(pTmp != NULL)
//		{
//			delete pTmp;
//		}
//		return *this;
//}
//
//std::string& std::string::operator+( std::string& s )
//{
//	this->length += s.length;
//	char* pTmp = this->str;
//	this->str = new char[this->length + 1];
//	strcpy(this->str,pTmp);
//	strcat(this->str,s.str);
//	this->str[this->length] = '\0';
//	if(pTmp != NULL)
//	{
//		delete pTmp;
//	}
//	return *this;
//}
//
//void std::string::operator+=( const char* c )
//{
//	this->length += strlen(c);
//	char* pTmp = this->str;
//	this->str = new char[this->length + 1];
//	strcpy(this->str,pTmp);
//	strcat(this->str,c);
//	this->str[this->length] = '\0';
//	if(pTmp != NULL)
//	{
//		delete pTmp;
//	}
//}
//
//void std::string::operator+=( std::string& s )
//{
//	this->length += s.length;
//	char* pTmp = this->str;
//	this->str = new char[this->length + 1];
//	strcpy(this->str,pTmp);
//	strcat(this->str,s.str);
//	this->str[this->length] = '\0';
//	if(pTmp != NULL)
//	{
//		delete pTmp;
//	}
//}
//
//bool std::string::operator<(const std::string& s )
//{
//	if(*(this->str) < *(s.str))
//	{
//		return true;
//	}
//	return false;
//}
//
//std::string& std::string::Empty()
//{
//	return emptyString;
//}

std::string JString::ToSmaller( std::string s)
{
	std::string::iterator ite = s.begin();
	for(;ite != s.end(); ++ite)
	{
		*ite = tolower(*ite);
	}
	return s;
}
